package com.lzq.model.factory.before;

/**
 * @author : modify
 * @version : v1.0
 * @description :
 * @createTime : 2022/11/14 17:18
 * @updateUser : modify
 * @updateTime : 2022/11/14 17:18
 * @updateRemark : 咖啡店
 */
public class CoffeeStore {
    private static final String LATTE_COFFEE = "LatteCoffee";

    public Coffee orderCoffee(String type) {
        CoffeeFactory factory = new CoffeeFactory();
        Coffee coffee = factory.createCoffee(type);
        if ((LATTE_COFFEE).equals(type)) {
            coffee.addMilk();
            coffee.addSugar();
        }
        return coffee;
    }
}

class Test {
    public static void main(String[] args) {
        CoffeeStore coffeeStore = new CoffeeStore();
        String name = coffeeStore.orderCoffee("LatteCoffee").getName();
        System.out.println(name);
    }
}
